package Package.IOStream.CharacterStream.UniqueFeatures;

import java.io.*;

public class UniqueFeatures {
    public static final void UniqueFeatures() throws IOException {
//        BufferedWriter：
//        void newLine() 写一行行分隔符，行分隔符字符串由系统属性定义
        BufferedWriter bw = new BufferedWriter(new
                FileWriter("D:\\insert\\a.java"));
//写数据
        for (int i = 0; i < 10; i++) {
            bw.write("hello" + i);
//bw.write("\r\n");
//            换行
            bw.newLine();
            bw.flush();
        }
//释放资源
        bw.close();
//      BufferedReaderStringreadLine()读一行文字。 结果包含行的内容的字符串，不包括任何行终止字符如果流的结尾已经到达，则为null
        BufferedReader br = new BufferedReader(new
                FileReader("D:\\insert\\a.java"));
        String line;
        while ((line=br.readLine())!=null) {
            System.out.println(line);
        }
        br.close();


    }
}
